get_med_ci <- function(medobj) {
  #ACME
  acme <-
    data.frame(
      outcome = "Average causal mediation effect",
      estimate = medobj$d1,
      lb95 = quantile(t(medobj$d1.sims), .025),
      ub95 = quantile(t(medobj$d1.sims), .975),
      lb90 = quantile(t(medobj$d1.sims), .05),
      ub90 = quantile(t(medobj$d1.sims), .95)
    )
  #ADE
  ade <-
    data.frame(
      outcome = "Average direct effect",
      estimate = medobj$z1,
      lb95 = quantile(t(medobj$z1.sims), .025),
      ub95 = quantile(t(medobj$z1.sims), .975),
      lb90 = quantile(t(medobj$z1.sims), .05),
      ub90 = quantile(t(medobj$z1.sims), .95)
    )
  #Total effect
  tau <-
    data.frame(
      outcome = "Total effect",
      estimate = medobj$tau.coef,
      lb95 = quantile(t(medobj$tau.sims), .025),
      ub95 = quantile(t(medobj$tau.sims), .975),
      lb90 = quantile(t(medobj$tau.sims), .05),
      ub90 = quantile(t(medobj$tau.sims), .95)
    )
  return(rbind(acme, ade, tau))
}